<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改学员信息')" />
    <th:block th:include="include :: datetimepicker-css" />
    <th:block th:include="include :: select2-css" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-student-edit" th:object="${crmStudent}">
            <input name="id" th:field="*{id}" type="hidden">
            <div class="row">
            <div class="col-xs-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">资源时间：</label>
                    <div class="col-sm-8">
                        <p class="form-control-plaintext" th:text="${#dates.format(crmStudent.resourceTime, 'yyyy-MM-dd HH:mm:ss')}"></p>
                    </div>
                </div>
            </div>
            <div class="col-xs-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">资源来源方式：</label>
                    <div class="col-sm-8">
                        <p class="form-control-plaintext" th:text="*{@dict.getLabel('crm_resource_type', resourceType)}"></p>
                    </div>
                </div>
            </div>
            </div>
            <div class="row">
            <div class="col-xs-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">渠道来源：</label>
                    <div class="col-sm-8">
                        <p class="form-control-plaintext" th:text="*{@dict.getLabel('crm_resource_code', resourceCode)}"></p>
                    </div>
                </div>
            </div>
            <div class="col-xs-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">来源用户：</label>
                    <div class="col-sm-8">
                        <p class="form-control-plaintext" th:text="*{resourceUser}"></p>
                    </div>
                </div>
            </div>
            </div>
            <div class="row">
            <div class="col-xs-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">学员评级：</label>
                    <div class="col-sm-8">
                        <p class="form-control-plaintext" th:text="*{@dict.getLabel('crm_student_level', levelCode)}"></p>
                    </div>
                </div>
            </div>
            <div class="col-xs-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">销售类型：</label>
                    <div class="col-sm-8">
                        <p class="form-control-plaintext" th:text="*{@dict.getLabel('crm_sales_type', salesType)}"></p>
                    </div>
                </div>
            </div>
            </div>
            <div class="row">
            <div class="col-xs-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">销售人员：</label>
                    <div class="col-sm-8">
                        <p class="form-control-plaintext" th:text="*{salesman}"></p>
                    </div>
                </div>
            </div>
            <div class="col-xs-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">姓名：</label>
                    <div class="col-sm-8">
                        <p class="form-control-plaintext" th:text="*{stuName}"></p>
                    </div>
                </div>
            </div>
            </div>
            <div class="row">
            <div class="col-xs-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">手机号：</label>
                    <div class="col-sm-8">
                        <p class="form-control-plaintext" th:text="*{stuMobile}"></p>
                    </div>
                </div>
            </div>
            <div class="col-xs-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">固定电话：</label>
                    <div class="col-sm-8">
                        <p class="form-control-plaintext" th:text="*{stuPhone}"></p>
                    </div>
                </div>
            </div>
            </div>
            <div class="row">
            <div class="col-xs-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">微信号：</label>
                    <div class="col-sm-8">
                        <p class="form-control-plaintext" th:text="*{stuWechat}"></p>
                    </div>
                </div>
            </div>
            <div class="col-xs-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">微信名：</label>
                    <div class="col-sm-8">
                        <p class="form-control-plaintext" th:text="*{stuWechatName}"></p>
                    </div>
                </div>
            </div>
            </div>
            <div class="row">
            <div class="col-xs-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">微信备注：</label>
                    <div class="col-sm-8">
                        <p class="form-control-plaintext" th:text="*{stuWechatNote}"></p>
                    </div>
                </div>
            </div>
            <div class="col-xs-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">QQ号：</label>
                    <div class="col-sm-8">
                        <p class="form-control-plaintext" th:text="*{stuQq}"></p>
                    </div>
                </div>
            </div>
            </div>
            <div class="row">
            <div class="col-xs-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">其他联系方式：</label>
                    <div class="col-sm-8">
                        <p class="form-control-plaintext" th:text="*{stuOtherContact}"></p>
                    </div>
                </div>
            </div>
            <div class="col-xs-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">学员省份：</label>
                    <div class="col-sm-8">
                        <p class="form-control-plaintext" th:text="*{stuProvince}"></p>
                    </div>
                </div>
            </div>
            </div>
            <div class="row">
            <div class="col-xs-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">学员城市：</label>
                    <div class="col-sm-8">
                        <p class="form-control-plaintext" th:text="*{stuCity}"></p>
                    </div>
                </div>
            </div>
            <div class="col-xs-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">学员地址：</label>
                    <div class="col-sm-8">
                        <p class="form-control-plaintext" th:text="*{stuAddress}"></p>
                    </div>
                </div>
            </div>
            </div>
            <div class="row">
            <div class="col-xs-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">学员学历编码：</label>
                    <div class="col-sm-8">
                        <p class="form-control-plaintext" th:text="*{@dict.getLabel('crm_edu_code', stuEducationCode)}"></p>
                    </div>
                </div>
            </div>
            <div class="col-xs-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">毕业学校：</label>
                    <div class="col-sm-8">
                        <p class="form-control-plaintext" th:text="*{stuCollege}"></p>
                    </div>
                </div>
            </div>
            </div>
            <div class="row">
            <div class="col-xs-12">
                <div class="form-group">
                    <label class="col-sm-2 control-label">客户需求：</label>
                    <div class="col-sm-10">
                        <p class="form-control-plaintext" th:text="*{stuDamand}"></p>
                    </div>
                </div>
            </div>
            </div>
            <div class="row">
            <div class="col-xs-12">
                <div class="form-group">
                    <label class="col-sm-2 control-label">备注：</label>
                    <div class="col-sm-10">
                        <p class="form-control-plaintext" th:text="*{note}"></p>
                    </div>
                </div>
            </div>
            </div>
        </form>
        <div class="ibox float-e-margins">
            <div id="ibox-content">
                <div id="vertical-timeline" class="vertical-container light-timeline">
                    <div class="vertical-timeline-block" th:each="followUp:${followUplist}">
                        <div class="vertical-timeline-icon navy-bg">
                            <i class="fa fa-phone"></i>
                        </div>
                        <div class="vertical-timeline-content">
                            <p>跟进内容：<span th:text="${followUp.followUpRecords}">跟进内容</span></p>
                            <p>
                                跟进方式：<span th:text="*{@dict.getLabel('crm_contact_code', followUp.followUpContactCode)}">跟进方式</span>
                                <br>
                                跟进人员:<span th:text="${followUp.followUpUser}"></span>
                                <br>
                                时间：<small th:text="${#dates.format(followUp.followUpTime, 'yyyy-MM-dd HH:mm:ss')}">2月3日</small>
                            </p>

                     </span>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: datetimepicker-js" />
    <th:block th:include="include :: select2-js" />
    <script th:inline="javascript">
        var prefix = ctx + "system/student";
        $("#form-student-edit").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {

                var data = $("#form-student-edit").serializeArray();
                var resourceUserId = $.form.selectSelects("resource-user");
                var salesmanId = $.form.selectSelects("salesman");

                data.push({"name": "resourceUserId", "value": resourceUserId});
                data.push({"name": "salesmanId", "value": salesmanId});

                $.operate.save(prefix + "/edit", data)

                // $.operate.save(prefix + "/edit", $('#form-student-edit').serialize());
            }
        }

        // $("input[name='resourceTime']").datetimepicker({
        //     format: "yyyy-mm-dd hh:ii",
        //     // minView: "month",
        //     autoclose: true
        // });

        $(function() {

            <!-- laydate -->
            layui.use('laydate', function(){
                var laydate = layui.laydate;
                laydate.render({
                    elem: '#resource-time',
                    type: 'datetime',
                    trigger: 'click'
                });
            });

            $('#resource-user').select2({
                placeholder: "请选择推广人员",
                allowClear: true
            });

            $('#salesman').select2({
                placeholder: "请选择销售人员",
                allowClear: true
            });
        })
    </script>
</body>
</html>